var express = require('express');
var router = express.Router();
const shopInfo = require("../schema/shop_info")

/* GET home page. */
router.get('/', function(req, res, next) {
  // 
  shopInfo.find({ 'name': '酸梅汤' }, function (err, person) {
    if (err) return handleError(err);
    // Prints "Space Ghost is a talk show host".
    res.send({a:person});
  });

});
router.get('/add/shopinfo', function(req, res, next) {
  let query = req.query
  const shopInfoModel = new shopInfo(query);
  shopInfoModel.save()
  res.send(query);
});
router.get('/update/shopinfo', function(req, res, next) {
  // let query = req.query
  shopInfo.findOneAndUpdate({_id:"606d2d62e7ec970e98c0135e"},{
    $set: {nums:10}
  },(e)=>{
    res.send(e);
  })
  
});
module.exports = router;
